#include "../MenuProfessor.h"

void MenuProfessor::configMenu(Menu* d)
{
    this->dad = d;
}

char MenuProfessor::showMenu()
{
    char opcode = ' ';
    cout << "\n+---------------------------------------+"
            "\n|          Menu Principal               |"
            "\n+---------------------------------------+"
            "\n|                                       |"
            "\n| [d] Disciplinas                       |"
            "\n|                                       |"
            "\n| [e] Editar Meus Dados                 |"
            "\n|                                       |"
            "\n| [x] Sair                              |"
            "\n|                                       |"
            "\n+---------------------------------------+"
            "\n"
            "\nOpcao escolhida: ";
    cin >> opcode;
    return opcode;
}

Menu* MenuProfessor::actionMenu(char opcode)
{
    Menu* menu_disciplina;
    Editar* edt;
    switch (opcode)
    {
        case 'd' :
            menu_disciplina = new MenuDisciplina();
            menu_disciplina->configMenu(this);
            return menu_disciplina;
            break;
        case 'e' :
            edt = new EditarUsuarioAtual();
            edt->showData();
            edt->getData();
            delete edt;
            return this;
            break;
        case 'x' :
            return NULL;
            break;
        default :
            cout << "\nOpcao invalida.\n";
            return this;
            break;
    }
}
